﻿namespace NET6.WebAPI.Helpers
{
    public static class VariableHelper
    {
        /*
         * ref: 常用于传递大型变量
         * out: 常用于返回多个结果, 也可以用元组
         */

        /// <summary>
        /// 交换两个变量的值
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="obj">变量 1</param>
        /// <param name="obj2">变量 2</param>
        public static void Exchange<T>(ref T obj, ref T obj2)
        {
            (obj2, obj) = (obj, obj2);
        }
    }
}
